////数据类型 1:单品；2：列表页(根据分类)； 3:分类页；4：新闻列表页  ；5：新闻页 ；6：商品类型；7：品牌分类 ；9：关键字；10:自定义url
function toLink(dataType, dataId,newWindowOpen,customUrl,indexClassDataId) {
	var skuBaseUrl = "/goods/{goodsId}.htm";
	var goodsClassifiedBaseUrl = "/goods/list.htm?goodsClassId={goodsClassId}";
	//var categoryBaseUrl = "/goodsClass/{selectedClassId}.htm";
	var newsClassBaseUrl = "/article/article.htm?articleClassId={articleClassId}";
	var newsDetailBaseUrl = "/article/detail/{newsId}.htm";
	//6：商品类型
	var listWithTypeUrl = "/goods/list.htm?typeClass={typeClass}";
	//7：品牌
	var listWithBrandUrl = "/goods/list.htm?brandId={brandId}&goodsClassId={goodsClassId}";
	//9：关键字
	var listWithKeyWordUrl = "/goods/list.htm?keyWord={keyWord}";
	var url = null;
	var dataTypeInt = 0;
	if((dataType+"").match(/^\d+$/)){
		dataTypeInt = parseInt(dataType);
	}
	switch (dataTypeInt) {
	case 1:
		url = skuBaseUrl.replace("{goodsId}", dataId);
		break;
	case 2:
		url = goodsClassifiedBaseUrl.replace("{goodsClassId}", dataId);
		break;
	//case 3:
	//	url = categoryBaseUrl.replace("{selectedClassId}", dataId);
	//	break;
	case 4:
		url = newsClassBaseUrl.replace("{articleClassId}", dataId);
		break;
	case 5:
		url = newsDetailBaseUrl.replace("{newsId}", dataId);
		break;
	case 6:
		url = listWithTypeUrl.replace("{typeClass}", dataId);
		break;
	case 7:
		url = listWithBrandUrl.replace("{brandId}", dataId);
		if(indexClassDataId){
			url = url.replace("{goodsClassId}", indexClassDataId);
		}else{
			url = url.replace("{goodsClassId}", "");
		}
		break;
	case 9:
		url = listWithKeyWordUrl.replace("{keyWord}", dataId);
		break;
	case 10:
		url = customUrl;	
		break;
	default:
		url = "/index.htm";
		break;
	}
	url = (10 == dataTypeInt?'':appPath)+url;
	if("1"==newWindowOpen){
		window.open(url);
	}else{
		window.location=url;
	}
}
